package cn.gson.school.dao.zhaosheng;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import cn.gson.school.entity.zhaosheng.InputStudentEntity;

/**
 * 招生模块--学员录入信息Dao
 */
@Repository
public interface InputStudentDao extends CrudRepository<InputStudentEntity, Long> {
	InputStudentEntity findByInputStuName(String stuname);
	
	//查询教学中的学生饼状图中录入学生的数量
	@Query(value="from InputStudentEntity")
	List<InputStudentEntity> chaXunAllInputStudent();
	
	@Query(value="from InputStudentEntity where year(inputTime)= ?1")
	List<InputStudentEntity> chaXunInputStudent(Integer year);
	
	//查询教学中的学生饼状图中录入学生的数量
	@Query(value="from InputStudentEntity where status = 2 and year(inputTime)= ?1")//convert(varchar(4),日期字段,120)='2013'
	List<InputStudentEntity> chaXunAllInputStudentone(Integer year);
	
}
